SftTree/OCX 7.0

SftTreeItem.Expanded Property

Softel vdm, Inc.

Defines whether the item is expanded or collapsed.

Syntax       

Get

VB.NET

Boolean = object.Expanded  As Boolean

VB

Boolean = object.Expanded  As Boolean

C#.NET

bool Boolean = object.Expanded;

VC++

VARIANT_BOOL Boolean = object->Expanded;
VARIANT_BOOL Boolean = object->GetExpanded();

C

HRESULT object->get_Expanded(VARIANT_BOOL* Boolean);

Delphi

Boolean := object.Expanded   : WordBool;

Put

VB.NET

object.Expanded = Boolean  As Boolean

VB

object.Expanded = Boolean  As Boolean

C#.NET

bool object.Expanded = Boolean;

VC++

VARIANT_BOOL object->Expanded = Boolean;
void object->PutExpanded(VARIANT_BOOL Boolean);

C

HRESULT object->put_Expanded(VARIANT_BOOL Boolean);

Delphi

object.Expanded := Boolean   : WordBool;

object

A SftTreeItem object.

Boolean

Defines whether the item is expanded or collapsed.

Boolean

Description

True

The item is expanded.

False

The item is collapsed.

Comments

The Expanded property defines whether the item is expanded or collapsed.

When setting Expanded to True, only an item's immediate dependents are made visible.  Dependents of items that are made visible are not automatically made visible.  The Items.Expand and Item.Expand method can be used to expand all immediate and indirect dependents.

If an item is already expanded when setting Expanded to True, the item remains unchanged.  It does not hide any indirect dependents.  To make sure that an item's indirect dependents are not shown, Expanded can be set to False first, which collapses the item (and all dependents), followed by setting Expanded to True.  Now only immediate dependents are visible.

An item has to be currently shown to be expanded or collapsed.  If the item is not shown, its state cannot be modified.  The Item.Shown property can be used to determine if an item is shown.

The Item.DependentCount property can be used to determine if an item can be expanded.  If an item doesn't have any dependents, it is a leaf item and cannot be expanded.  However, it is not an error to use Expanded with a leaf item.

The Expanded property does not preserve or restore the expand/collapse state of its dependent items.  Use Items.Expand, Item.Expand, Items.Collapse and Item.Collapse to preserve or restore this information.

If a parent item is collapsed, subsequently adding child items will automatically expand the item.

See Also  SftTreeItem Object | Object Hierarchy


Feedback / comments / error reports for this topic
© 2015 - Softel vdm, Inc. - www.softelvdm.com